package com.by.service.impl;

import com.by.bean.Sspecs;
import com.by.bean.updateinventory;
import com.by.common.core.crud.BaseServiceImpl;
import com.by.mapper.SspecsMapper;
import com.by.service.SspecsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SspecsServiceimpl extends BaseServiceImpl<Sspecs, SspecsMapper> implements SspecsService {
    @Autowired
    SspecsMapper ssm;
    @Override
    public List<Map> querybygoodsid(int goodsId) {
        List list= ssm.querybygoodsid(goodsId);
        return  list;
    }
    @Override
    public int updateinventory(List<updateinventory> list) {
        int a;
        int count=0;
        for (int i = 0; i < list.size(); i++) {
            a=ssm.updateinventorybylist(list.get(i));
            count=count+a;
        }
        System.out.println(count);
        return count;
    }
}
